//
//  GYOrderEvaluateFootView.m
//  GoodLuck
//
//  Created by apple on 2018/3/23.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import "GYOrderEvaluateFootView.h"
#import "RatingBar.h"

@interface GYOrderEvaluateFootView ()

/** 描述评分 */
@property (nonatomic, strong) RatingBar *desRatingBar;

/** 服务评分 */
@property (nonatomic, strong) RatingBar *serviceRatingBar;

/** 发货速度 */
@property (nonatomic, strong) RatingBar *deliverRatingBar;

@property (weak, nonatomic) IBOutlet UIButton *subEvaluateBtu;

@property (weak, nonatomic) IBOutlet UILabel *desLable;
@property (weak, nonatomic) IBOutlet UILabel *serviceLable;
@property (weak, nonatomic) IBOutlet UILabel *deliverLable;

@end
@implementation GYOrderEvaluateFootView

- (void)awakeFromNib {
    [super awakeFromNib];
    self.subEvaluateBtu.layer.cornerRadius = 4
    ;
    
    self.desRatingBar = [self creatRatingBarView:CGRectMake(CGRectGetMaxX(self.desLable.frame), self.desLable.center.y, 180, 20)];
    self.serviceRatingBar = [self creatRatingBarView:CGRectMake(CGRectGetMaxX(self.serviceLable.frame), self.serviceLable.center.y, 180, 20)];
    self.deliverRatingBar = [self creatRatingBarView:CGRectMake(CGRectGetMaxX(self.deliverLable.frame), self.deliverLable.center.y, 180, 20)];
    
}

//提价评价按钮
- (IBAction)subEvaluateBtuClick:(UIButton *)sender {
    self.subOrderEvaluateCallBack(self.desRatingBar.starNumber, self.serviceRatingBar.starNumber, self.deliverRatingBar.starNumber);
}

- (RatingBar *)creatRatingBarView:(CGRect)frame {
    RatingBar *bar = [[RatingBar alloc] initWithFrame:frame];
    [self addSubview:bar];
    
    return bar;
}

-  (CGFloat)getHeight {
    
    return CGRectGetMaxY(self.subEvaluateBtu.frame)+20;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
